package com.y.fund.aacore.enums;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(title="登录状态")
public enum LoginState {
	Login(1,"登录中"), Logout(-1,"已正常退出"), LogoutByForce(-2,"被管理员强制退出");
	
    private final int val;
    private final String name;

    LoginState(int value, String name) {
        this.val = value;
        this.name = name;
    }
    
    public int getVal() {
        return val;
    }
    public String getName() {
        return name;
    }

    public static LoginState ofVal(Integer val) {
        if (null != val) {
            for (LoginState boolVal : LoginState.values()) {
                if (val.equals(boolVal.getVal())){
                    return boolVal;
                }
            }
        }
        return null;
    }
}
